package tech.eyao.hs60x.serviceImpl;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.eyao.hs60x.service.TokenService;
import tech.eyao.hs60x.token.RedisTokenManager;

@Service
public class TokenServiceImpl implements TokenService {
	private static final Logger logger = LoggerFactory.getLogger(TokenServiceImpl.class);
	@Autowired
	RedisTokenManager redisTokenManager;

	@Override
	public String createToken(long userId,String passWord,String deviceId,String ismi) {
		String token = StringUtils.EMPTY;
		try {
			token = redisTokenManager.acquireToken(userId,deviceId);
		} catch (Exception e) {
			logger.error("[TokenService createToken error .]", e);
		}
		return token;
	}

}
